package com.myoffice.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TLoginlog entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "T_LOGINLOG", schema = "OA")
public class TLoginlog implements java.io.Serializable {

	// Fields

	private String id;
	private TUserinfo TUserinfo;
	private Date time;
	private String ifsuccess;
	private String userip;
	private String descs;
	private Set<TOperatelog> TOperatelogs = new HashSet<TOperatelog>(0);

	// Constructors

	/** default constructor */
	public TLoginlog() {
	}

	/** minimal constructor */
	public TLoginlog(String id, TUserinfo TUserinfo, Date time,
			String ifsuccess, String userip) {
		this.id = id;
		this.TUserinfo = TUserinfo;
		this.time = time;
		this.ifsuccess = ifsuccess;
		this.userip = userip;
	}

	/** full constructor */
	public TLoginlog(String id, TUserinfo TUserinfo, Date time,
			String ifsuccess, String userip, String descs,
			Set<TOperatelog> TOperatelogs) {
		this.id = id;
		this.TUserinfo = TUserinfo;
		this.time = time;
		this.ifsuccess = ifsuccess;
		this.userip = userip;
		this.descs = descs;
		this.TOperatelogs = TOperatelogs;
	}

	// Property accessors
	@Id
	@Column(name = "ID", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USERID", nullable = false)
	public TUserinfo getTUserinfo() {
		return this.TUserinfo;
	}

	public void setTUserinfo(TUserinfo TUserinfo) {
		this.TUserinfo = TUserinfo;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "TIME", nullable = false, length = 7)
	public Date getTime() {
		return this.time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	@Column(name = "IFSUCCESS", nullable = false)
	public String getIfsuccess() {
		return this.ifsuccess;
	}

	public void setIfsuccess(String ifsuccess) {
		this.ifsuccess = ifsuccess;
	}

	@Column(name = "USERIP", nullable = false)
	public String getUserip() {
		return this.userip;
	}

	public void setUserip(String userip) {
		this.userip = userip;
	}

	@Column(name = "DESCS")
	public String getDescs() {
		return this.descs;
	}

	public void setDescs(String descs) {
		this.descs = descs;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TLoginlog")
	public Set<TOperatelog> getTOperatelogs() {
		return this.TOperatelogs;
	}

	public void setTOperatelogs(Set<TOperatelog> TOperatelogs) {
		this.TOperatelogs = TOperatelogs;
	}

}